"""
https://docs.python.org/3/howto/argparse.html
"""
import argparse

parser = argparse.ArgumentParser()
parser.add_argument('echo', help='echo the string you use here')
parser.add_argument('base', help='base number to be squared (type=float)', type=float)
parser.add_argument('-v', '--verbose', help='increase output verbosity', action='store_true')
parser.add_argument('--verbosity', help='increase output verbosity (type=int)', type=int, default=1)
args = parser.parse_args()
p = args.echo
print('args.echo:', p, type(p))
base = args.base
square = base ** 2
print(f'arg.base({base}) ** 2:', square)
p = args.verbose
print('arg.verbose:', p, type(p))
if p:
    print('verbose turned on')
    print(f'Square of {base} is {square}')
else:
    print('verbose turned off')
p = args.verbosity
print('args.verbosity:', p, type(p))
for i in range(p):
    print(f'{i + 1: 4}: arg.base({base}) ** 2:', square)
